﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using DataObjectsPhone;
using System.Windows.Media.Imaging;
namespace ee_wp_tourmaker
{
	public partial class ChallengeCell : UserControl
	{
        private Challenge content;

		public ChallengeCell()
		{
			// Required to initialize variables
			InitializeComponent();

            
		}

        /// <summary>
        /// Sets the content of the cell
        /// sets the checkpointscountslabel 
        /// sets the pointslabel
        /// </summary>
        /// <param name="c"></param>
        public void setChallenge(Challenge c)
        {
            content = c;
            this.challengeNameTextBox.Text = c.Name;
            this.checkPointsCountlabel.Text = c.Checkpoints + " Checkpoints";
            this.challengePointsLabel.Text = c.Points + "  Points";

            Visibility darkBackgroundVisibility =
          (Visibility)Application.Current.Resources["PhoneDarkThemeVisibility"];
            if (darkBackgroundVisibility == Visibility.Visible)
            {
                challengeImage.Source = new BitmapImage(new Uri("../Icons/challengeCellImage_white.png", UriKind.RelativeOrAbsolute));
            }
            else
            {
                challengeImage.Source = new BitmapImage(new Uri("../Icons/challengeCellImage_black.png", UriKind.RelativeOrAbsolute));
            }


        }
	}
}